Conversation
| <nav className="flex gap-6 justify-center items-center"> | ||
| <Link | ||
| to="/btc" | ||
| className={twJoin( | ||
| "w-32 h-10 text-center whitespace-nowrap flex items-center justify-center", | ||
| pathname.startsWith("/btc") | ||
| ? "text-accent-primary" | ||
| : "text-accent-secondary", | ||
| )} | ||
| > | ||
| BTC Staking | ||
| </Link> | ||
| <Link | ||
| to="/baby" | ||
| className={twJoin( | ||
| "w-32 h-10 text-center whitespace-nowrap flex items-center justify-center", | ||
| pathname.startsWith("/baby") | ||
| ? "text-accent-primary" | ||
| : "text-accent-secondary", | ||
| )} | ||
| > | ||
| BABY Staking | ||
| </Link> | ||
| </nav> |
There was a problem hiding this comment.
Move it to separate component:
<Nav>
<NavItem title="BTC Staking" to="/btc" />
<NavItem title="BABY Staking" to="/baby" />
</Nav>| <Link | ||
| to="/baby" | ||
| className={twJoin( | ||
| "w-32 h-10 text-center whitespace-nowrap flex items-center justify-center", | ||
| pathname.startsWith("/baby") | ||
| ? "text-accent-primary" | ||
| : "text-accent-secondary", | ||
| )} | ||
| > | ||
| BABY Staking | ||
| </Link> |
There was a problem hiding this comment.
Use NavLink instead:
<NavLink
to="/messages"
className={({ isActive, isPending, isTransitioning }) =>
[
isPending ? "pending" : "",
isActive ? "active" : "",
isTransitioning ? "transitioning" : "",
].join(" ")
}
>
Messages
</NavLink>| export default function BabyStaking() { | ||
| const cosmosWallet = useCosmosWallet(); | ||
| const { bech32Address, connected } = cosmosWallet; | ||
| console.log({ cosmosWallet }); |
| }, 0); | ||
| }; | ||
|
|
||
| const totalStaked = delegations.reduce((total, delegation) => { |
There was a problem hiding this comment.
Let's not add anything does not fit into the MVP. The more code we have, the more issues/bug we may discover which delay the delivery.
Keep it simply and lean is the best option for now
| try { | ||
| await claimRewards(bech32Address, validatorAddress); | ||
| await delegationRewardsQuery.refetch(); | ||
| alert("Rewards claimed successfully!"); |
There was a problem hiding this comment.
why do we need to have alert for successful event?
| <p className="text-lg font-bold">{validators.length}</p> | ||
| </div> | ||
| </div> | ||
| </div> |
There was a problem hiding this comment.
Didn't we have a dedicated tab for rewards? In that case we don't need this stats tab for MVP.
User can refer to their wallet for balance and rewards tab for the rewards amount
| const stakedAmount = ubbnToBaby( | ||
| parseFloat(delegation.balance?.amount || "0"), | ||
| ); | ||
| const rewardsAmount = getRewardsForValidator(validatorAddress); |
There was a problem hiding this comment.
sorry, not fully understanding what we showing here. are you plan to show rewards per delegation? i could not find this in the design file.
We should have a single button to claim all rewards instead
| const BBN_REWARDS_KEY = "BBN_REWARDS"; | ||
| const BBN_DELEGATIONS_KEY = "BBN_DELEGATIONS"; | ||
| const BBN_DELEGATION_REWARDS_KEY = "BBN_DELEGATION_REWARDS"; | ||
| const BBN_VALIDATORS_KEY = "BBN_VALIDATORS"; |
There was a problem hiding this comment.
I think we should start seperating the BTC and BABY here.
For example BBN_REWARDS_KEY is actual BBN_BTC_STAKING_REWARDS_KEY.
| /** | ||
| * [BABY Staking] Gets all delegations of the user's account. | ||
| */ | ||
| const delegationsQuery = useClientQuery({ |
There was a problem hiding this comment.
How about name it properly as babyStakingDelegationQuery etc so that we not confused with btc staking.
Of course, the old btc ones should be renamed too
#1201